package com.example.bzh.gamecat.ui.live.newest;

import com.example.bzh.gamecat.bean.newest.Newest;
import com.example.bzh.gamecat.httputils.newestutils.NewestHttpUtil;

import java.util.HashMap;

/**
 * Created by lenovo on 2016/8/18.
 */
public class NewestPresenter implements NewestContract.Presenter {

    private NewestContract.View view;
    private NewestContract.Model model;
    public NewestPresenter(NewestContract.View view,NewestContract.Model model){
        this.view = view;
        this.model = model;
    }

    @Override
    public void initData(HashMap<String, String> params) {
       model.getInitData(params, new NewestHttpUtil.HttpCallBack<Newest>() {
           @Override
           public void onSucess(Newest newest) {
               view.onSuccess(newest.getData().getDistractionList());
           }

           @Override
           public void onFail() {
               view.onFail("交易失败");
           }
       });
    }
}
